#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'libb@anchent.com'

from PIL import Image

with Image.open("../assets/004.jpg") as image:
    print(image.format, image.size, image.mode)
    # image.show()

    # 1.裁剪图片
    # rect = 80, 20, 310, 360
    # image.crop(rect).show()

    # 2.生成缩略图
    size = 128, 128
    image.thumbnail(size)
    image.show()
